package com.anji.plus.gaea.inf.constant;

import java.util.regex.Pattern;

/**
 * @author ultrajiaming
 * @since 2021/3/29 9:57
 */
public interface InfConstant {

    /**
     * 匹配 #{xxx}
     **/
    Pattern PREPARED_SQL_PATTERN = Pattern.compile("\\#\\{(\\w*)\\}");

    /**
     * 匹配 in #{xxx}
     **/
    Pattern PREPARED_IN_SQL_PATTERN = Pattern.compile("in\\s*\\#\\{(\\w*)\\}");

    /**
     * 匹配数据库名
     **/
    Pattern PATTERN_DATABASE_NAME = Pattern.compile("(from|join)[\\s]*(\\S*)\\.\\S*[\\s]");

    /**
     * 动态sql的入参名称
     **/
    String DYNAMIC_SQL_KEY = "dynamicSql";

    /**
     * 请求头中的接口名称
     **/
    String REQUEST_HEADER_INF_NAME = "Inf-Name";

    /**
     * 请求头中的接口名称
     **/
    String REQUEST_HEADER_APP_ID = "Inf-App-Id";

    /**
     * 请求头中的接口名称
     **/
    String REQUEST_HEADER_APP_SECRET = "Inf-App-Secret";

    /**
     * 响应参数  json的key
     **/
    String REQUEST_PARAM_KEY_NAME = "paramName";
    String RESPONSE_PARAM_KEY_NAME = "name";
    String REQUEST_PARAM_KEY_TYPE = "dataType";
    String RESPONSE_PARAM_KEY_TYPE = "type";
    String PARAM_KEY_MAP = "map";
    String RESPONSE_PARAM_KEY_DESC = "description";
    String REQUEST_PARAM_KEY_DESC = "desc";
    String PARAM_KEY_REQUIRE = "require";
    String PARAM_KEY_CHILDREN = "children";

    String EXECUTE_SQL_PARAM_INFNAME = "infName";
    String EXECUTE_SQL_PARAM_QUERYPARAM = "queryParams";
}
